/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.assembler;

import vip.dexian.admin.entity.Department;
import vip.dexian.core.base.mapstruct.TreeEntityIgnore;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

/**
 * 部门属性复制
 *
 * @author 挺好的 2023年06月01日 10:08
 */
@Mapper (componentModel = "spring", builder = @Builder (disableBuilder = true))
public interface DepartmentMappingTargetAssembler {

    /**
     * 复制属性
     *
     * @param source
     *         源
     * @param target
     *         目标
     *
     * @return {@link Department}
     */
    @TreeEntityIgnore
    @Mapping (target = "parent", ignore = true)
    @Mapping (target = "children", ignore = true)
    Department copy (Department source, @MappingTarget Department target);
}
